<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Fungsi extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    function tulis(){
        $hasil = "<b>INI di Tulis dari Model</b>";
        return $hasil;
    }
    
    function rekening3($param = '') {
        $hasil = array();
        
        if($param==''){
            $query = $this->db->query("SELECT * FROM ms_rek3 ORDER BY kd_rek3");
        }else{
            $query = $this->db->query("SELECT * FROM ms_rek3 where left(kd_rek3,1) = '$param' ORDER BY kd_rek3 ");
        }
        
        foreach ($query->result_array() as $row) {
            $hasil[] = array(
                "kd_rek3"   => $row['kd_rek3'],
                "nm_rek3"   => $row['nm_rek3']
            );
        }
        return $hasil;
    }
}
?>